import 'package:base_plugin/base_plugin.dart';
import 'package:finance_app/generated/l10n.dart';
import 'package:finance_app/src/common/app_colors.dart';
import 'package:finance_app/src/common/app_spaces.dart';
import 'package:finance_app/src/router_gen/router_gen_providers.dart';
import 'package:finance_app/src/widgets/bottom_sheet/default_info_bottom_sheet.dart';
import 'package:finance_app/src/widgets/button/normal_button.dart';
import 'package:flutter/material.dart';

// login with no active company
showNoActiveCompanyBottomSheet(BuildContext context, {VoidCallback onDelete, VoidCallback onCancel}) => showDeleteInfoBottomSheet(context,
    S.current.permissions_disabled, S.current.you_no_longer_have_permission_to_access_data_from_all_businessess_linked_to_your_account_would_you_like_to,
    onDelete: onDelete, onCancel: onCancel, sureBtnText: S.current.add_new_business, cancelText: S.current.logout);

showSuccessFullyReconciledBottomSheet(BuildContext context, {VoidCallback onDelete, VoidCallback onCancel}) =>
    showDeleteInfoBottomSheet(context, S.current.you_have_successfully_reconciled_this_bank_account, null,
        onDelete: onDelete, onCancel: onCancel, sureBtnText: S.current.got_it, cancelText: S.current.view_report);

showSuccessGotItBottomSheet(BuildContext context, String title, {VoidCallback onDelete}) =>
    showDeleteInfoBottomSheet(context, title, null, onDelete: onDelete, sureBtnText: S.current.got_it);

// processed without tax figures
showUndoReconciliationBottomSheet(BuildContext context, {VoidCallback onDelete, VoidCallback onCancel}) =>
    showDeleteInfoBottomSheet(context, S.current.undo_reconciliation + '?', S.current.all_reconciled_transactions_will_be_mark_as_outstanding,
        onDelete: onDelete, onCancel: onCancel, sureBtnText: S.current.undo, cancelText: S.current.cancel);

// processed without tax figures
showProcessWithoutTaxFiguresBottomSheet(BuildContext context, {VoidCallback onDelete, VoidCallback onCancel}) =>
    showDeleteInfoBottomSheet(context, S.current.do_you_want_to_proceed_without_tax_figures, null,
        onDelete: onDelete, onCancel: onCancel, sureBtnText: S.current.yes, cancelText: S.current.verify_tax_figures_first);

// 删除  fixed asset
showDeleteFixedAssetBottomSheet(BuildContext context, {VoidCallback onDelete, VoidCallback onCancel}) =>
    showDeleteInfoBottomSheet(context, S.current.delete_this_fixed_asset, S.current.all_information_related_to_this_fixed_asset_will_also_be_deleted,
        onDelete: onDelete, onCancel: onCancel, sureBtnText: S.current.delete);

// 移除Credit Card
showRemovePaymentMethodBottomSheet(BuildContext context, String creditNumber, {VoidCallback onDelete, VoidCallback onCancel}) =>
    showDeleteInfoBottomSheet(context, S.current.remove_payment_method, null,
        onDelete: onDelete,
        contentSpan: TextSpan(children: [
          TextSpan(text: 'Card $creditNumber\n', style: TextStyle(fontWeight: FontWeight.w700)),
          TextSpan(text: 'will be removed from the list'),
        ]),
        onCancel: onCancel,
        sureBtnText: S.current.remove);

//切换Payment method
showChangePaymentMethodBottomSheet(BuildContext context, String creditNumber, {VoidCallback onDelete, VoidCallback onCancel}) =>
    showDeleteInfoBottomSheet(context, S.current.change_payment_method, null,
        onDelete: onDelete,
        contentSpan: TextSpan(children: [
          TextSpan(text: S.current.monthly_subscription_fee_will_be_charged_to_),
          TextSpan(text: 'card $creditNumber', style: TextStyle(fontWeight: FontWeight.w700)),
        ]),
        onCancel: onCancel,
        sureBtnText: S.current.change);
// 移除邀请人
showDisableInvitationBottomSheet(BuildContext context, {VoidCallback onDelete, VoidCallback onCancel}) =>
    showDeleteInfoBottomSheet(context, S.current.disable_team_member, S.current.he_she_will_not_be_able_to_access_your_company_related_information,
        onDelete: onDelete, onCancel: onCancel, sureBtnText: S.current.disable);

// 移除邀请人
showRemoveInvitationBottomSheet(BuildContext context, {VoidCallback onDelete, VoidCallback onCancel}) =>
    showDeleteInfoBottomSheet(context, S.current.remove_invitation, S.current.invitation_link_will_be_made_invalid_and_access_will_not_be_granted,
        onDelete: onDelete, onCancel: onCancel, sureBtnText: S.current.remove);

// 拒绝费用报销
showRejectExpenseClaimBottomSheet(BuildContext context, {VoidCallback onDelete, VoidCallback onCancel}) =>
    showDeleteInfoBottomSheet(context, S.current.reject_expense_claim, S.current.it_will_be_marked_as_rejected,
        onDelete: onDelete, onCancel: onCancel, sureBtnText: S.current.reject);

// 批准费用报销
showApproveExpenseClaimBottomSheet(BuildContext context, {VoidCallback onDelete, VoidCallback onCancel}) =>
    showDeleteInfoBottomSheet(context, S.current.approve_expense_claim, S.current.it_will_be_marked_as_approved,
        onDelete: onDelete, onCancel: onCancel, sureBtnText: S.current.approve);

// 批准假期
showApproveLeaveBottomSheet(BuildContext context, {VoidCallback onDelete, VoidCallback onCancel}) =>
    showDeleteInfoBottomSheet(context, S.current.approve_leave, S.current.leave_will_be_marked_as_approved_and_leave_balance_will_be_adjusted_accordingly,
        onDelete: onDelete, onCancel: onCancel, sureBtnText: S.current.approve);

// 取消假期
showWithdrawLeaveBottomSheet(BuildContext context, {VoidCallback onDelete, VoidCallback onCancel}) =>
    showDeleteInfoBottomSheet(context, S.current.withdraw_leave, S.current.you_will_not_be_able_to_undo_this_change_once_you_withdraw_this_leave,
        onDelete: onDelete, onCancel: onCancel, sureBtnText: S.current.withdraw);

// 删除假期
showDeleteLeaveBottomSheet(BuildContext context, {VoidCallback onDelete, VoidCallback onCancel}) =>
    showDeleteInfoBottomSheet(context, S.current.delete_leave, S.current.all_information_related_to_this_leave_will_also_be_deleted,
        onDelete: onDelete, onCancel: onCancel);

// 调整假期
showAdjustLeaveBottomSheet(BuildContext context, {VoidCallback onDelete, VoidCallback onCancel}) =>
    showDeleteInfoBottomSheet(context, S.current.adjust_leave, S.current.leave_will_be_adjusted_accordingly_for_selected_employee,
        onDelete: onDelete, onCancel: onCancel, sureBtnText: S.current.adjust);
// 删除未付款的账单
showDeletePayslipsBottomSheet(BuildContext context, {VoidCallback onDelete, VoidCallback onCancel}) =>
    showDeleteInfoBottomSheet(context, S.current.delete_this_payslip, S.current.all_information_related_to_this_payslip_will_also_be_deleted,
        onDelete: onDelete, onCancel: onCancel);

// 删除账号
showDeleteAccountInfoBottomSheet(BuildContext context, {VoidCallback onDelete, VoidCallback onCancel}) => showDeleteInfoBottomSheet(
    context,
    S.current.delete_this_account,
    S.current.you_will_not_be_able_to_select_it_for_future_transactions_and_any_information_related_to_this_account_cannot_be_recovered__,
    onDelete: onDelete,
    onCancel: onCancel);

// 删除journal entry
showDeleteJournalEntryInfoBottomSheet(BuildContext context, {VoidCallback onDelete, VoidCallback onCancel}) => showDeleteInfoBottomSheet(
    context, S.current.delete_general_journal, S.current.all_attachments_and_information_related_to_this_general_journal_will_also_be_deleted,
    onDelete: onDelete, onCancel: onCancel);

// 删除联系人
showDeleteContactPersonInfoBottomSheet(BuildContext context, {VoidCallback onDelete, VoidCallback onCancel}) => showDeleteInfoBottomSheet(
    context, S.current.delete_contact_person, S.current.you_will_lose_all_information_that_are_recorded_for_the_selected_contact_person,
    onDelete: onDelete, onCancel: onCancel);

// 删除coa
showDeleteCoaInfoBottomSheet(BuildContext context, {VoidCallback onDelete, VoidCallback onCancel}) =>
    showDeleteInfoBottomSheet(context, S.current.delete_subaccount, S.current.you_will_lose_all_information_that_are_recorded_for_this_subaccount,
        onDelete: onDelete, onCancel: onCancel);

// 删除联系人
showDeleteContactInfoBottomSheet(BuildContext context, {VoidCallback onDelete, VoidCallback onCancel}) =>
    showDeleteInfoBottomSheet(context, S.current.delete_contact, S.current.you_will_lose_all_information_that_are_recorded_for_the_selected_contacts,
        onDelete: onDelete, onCancel: onCancel);

// 禁用服务提示框
showServiceDeactivateInfoBottomSheet(BuildContext context, {VoidCallback onDelete, VoidCallback onCancel}) =>
    showDeleteInfoBottomSheet(context, S.current.deactivate_this_service, S.current.you_will_not_be_able_to_select_it__for_future_transactions,
        onDelete: onDelete, onCancel: onCancel, sureBtnText: S.current.deactivate);

// 删除服务提示框
showServiceDeleteInfoBottomSheet(BuildContext context, {VoidCallback onDelete, VoidCallback onCancel}) =>
    showDeleteInfoBottomSheet(context, S.current.delete_this_service, S.current.you_will_not_be_able_to_recover_information_related_to_this_service,
        onDelete: onDelete, onCancel: onCancel);

// 禁用产品提示框
showProductDeactivateInfoBottomSheet(BuildContext context, {VoidCallback onDelete, VoidCallback onCancel}) => showDeleteInfoBottomSheet(context,
    S.current.deactivate_product, S.current.you_will_not_be_able_to_select_it_for_future_transactions_and_any_inventory_tracking_will_also_be_deactivated__,
    onDelete: onDelete, onCancel: onCancel, sureBtnText: S.current.deactivate);

// 删除产品提示框
showProductDeleteInfoBottomSheet(BuildContext context, {VoidCallback onDelete, VoidCallback onCancel}) =>
    showDeleteInfoBottomSheet(context, S.current.delete_product, S.current.you_will_not_be_able_to_recover_information_related_to_selected_products,
        onDelete: onDelete, onCancel: onCancel);

// Mark as Rejected
showMarkAsRejectedInfoBottomSheet(BuildContext context, {VoidCallback onDelete, VoidCallback onCancel}) =>
    showDeleteInfoBottomSheet(context, S.current.mark_as_rejected, S.current.quotation_will_be_marked_as_rejected,
        onDelete: onDelete, onCancel: onCancel, sureBtnText: S.current.mark_as_reject);

// keep credit
showKeepCreditInfoBottomSheet(BuildContext context, {VoidCallback onDelete, VoidCallback onCancel}) =>
    showDeleteInfoBottomSheet(context, S.current.keep_as_credit, S.current.amount_will_be_credited_to_merchants_account,
        onDelete: onDelete, onCancel: onCancel, sureBtnText: S.current.keep);

// apply credit
Future<void> showApplyCreditInfoBottomSheet(BuildContext context, String subTitle, {bool isBill = true, VoidCallback onDelete, VoidCallback onCancel}) async =>
    await showDeleteInfoBottomSheet(
        context, S.current.apply_credit_available, isBill ? S.current.would_you_like_to_apply_to_this_bill : S.current.would_you_like_to_apply_to_this_invoice,
        subTitle: subTitle, onDelete: onDelete, onCancel: onCancel, sureBtnText: S.current.choose_account, cancelText: S.current.continue_without_credit);

// keep credit debit
showKeepDebitCreditInfoBottomSheet(BuildContext context, {VoidCallback onDelete, VoidCallback onCancel}) =>
    showDeleteInfoBottomSheet(context, S.current.keep_as_credit, S.current.amount_will_be_credited_to_your_account,
        onDelete: onDelete, onCancel: onCancel, sureBtnText: S.current.keep);
// 删除 credit note
showDeleteCreditNoteInfoBottomSheet(BuildContext context, {VoidCallback onDelete, VoidCallback onCancel}) => showDeleteInfoBottomSheet(
      context,
      S.current.delete_this_credit_note,
      S.current.all_information_related_to_this_credit_note_will_also_be_deleted,
      onDelete: onDelete,
      onCancel: onCancel,
    );

showDeleteDebitNoteInfoBottomSheet(BuildContext context, {VoidCallback onDelete, VoidCallback onCancel}) => showDeleteInfoBottomSheet(
      context,
      S.current.delete_this_debit_note,
      S.current.all_information_related_to_this_debit_note_will_also_be_deleted,
      onDelete: onDelete,
      onCancel: onCancel,
    );

//删除交易订单
showDeleteTransactionInfoBottomSheet(BuildContext context, {VoidCallback onDelete, VoidCallback onCancel}) => showDeleteInfoBottomSheet(
      context,
      S.current.delete_this_transaction,
      S.current.all_attachments_and_information_related_to_this_transaction_will_also_be_deleted,
      onDelete: onDelete,
      onCancel: onCancel,
    );

// 删除 expense
showDeleteExpenseInfoBottomSheet(BuildContext context, {VoidCallback onDelete, VoidCallback onCancel}) => showDeleteInfoBottomSheet(
      context,
      S.current.delete_expense_claim,
      S.current.all_information_related_to_this_expense_claim_will_also_be_deleted,
      onDelete: onDelete,
      onCancel: onCancel,
    );

// withdraw expense
showWithdrawExpenseInfoBottomSheet(BuildContext context, {VoidCallback onDelete, VoidCallback onCancel}) => showDeleteInfoBottomSheet(
      context,
      S.current.withdraw_from_payslip,
      S.current.this_expense_claim_will_be_moved_to_pending,
      sureBtnText: S.current.withdraw,
      onDelete: onDelete,
      onCancel: onCancel,
    );

//删除附件
showDeleteAttachmentInfoBottomSheet(BuildContext context, {VoidCallback onDelete, VoidCallback onCancel}) => showDeleteInfoBottomSheet(
      context,
      S.current.delete_attachment,
      null,
      onDelete: onDelete,
      onCancel: onCancel,
    );

// Ready for Upgrade
showReadyForUpgradeBottomSheet(BuildContext context, {VoidCallback onConfirm, VoidCallback onCancel}) =>
    showDeleteInfoBottomSheet(context, S.current.ready_for_upgrade, S.current.please_upgrade_your_plan_to_use_this_feature, onDelete: () {
      Navigator.pop(context);
      Routes.navigateTo(RouterGenProviders.subscriptionPage, params: {'tabIndex': 1});
    }, onCancel: onCancel, sureBtnText: S.current.choose_plan, cancelText: S.current.not_now);

// Trial Has Ended
showTrialHasExpiredBottomSheet(BuildContext context, {VoidCallback onConfirm, VoidCallback onCancel}) =>
    showDeleteInfoBottomSheet(context, S.current.trial_has_ended, S.current.please_subscribe_to_continue_using, onDelete: () {
      Navigator.pop(context);
      Routes.navigateTo(RouterGenProviders.subscriptionPage, params: {'tabIndex': 1});
    }, onCancel: onCancel, sureBtnText: S.current.choose_plan, cancelText: S.current.not_now);

// Subsciption Has Expired
showSubscriptionExpiredBottomSheet(BuildContext context, {VoidCallback onConfirm, VoidCallback onCancel}) =>
    showDeleteInfoBottomSheet(context, S.current.subscription_has_expired, S.current.please_renew_subscription_to_continue_using, onDelete: () {
      Navigator.pop(context);
      Routes.navigateTo(RouterGenProviders.subscriptionPage, params: {'tabIndex': 1});
    }, onCancel: onCancel, sureBtnText: S.current.renew_subscription, cancelText: S.current.not_now);

// Generate Payslip Confirmation
showGeneratePayslipConfirmationBottomSheet(BuildContext context, String content, {VoidCallback onConfirm, VoidCallback onCancel}) =>
    showDeleteInfoBottomSheet(context, S.current.confirm_to_generate_payslip, content, onDelete: () {
      Navigator.pop(context, true);
    }, onCancel: onCancel, sureBtnText: S.current.confirm, cancelText: S.current.cancel);

//删除role
showDeleteRoleBottomSheet(BuildContext context, {VoidCallback onDelete, VoidCallback onCancel}) => showDeleteInfoBottomSheet(
      context,
      S.current.delete_this_role,
      '',
      onDelete: onDelete,
      onCancel: onCancel,
    );

// 删除 cpf contribution
showDeleteCpfContributionBottomSheet(BuildContext context, {VoidCallback onDelete, VoidCallback onCancel}) => showDeleteInfoBottomSheet(
      context,
      S.current.delete_this_cpf_contribution,
      S.current.this_cpf_contribution_will_be_deleted,
      onDelete: onDelete,
      onCancel: onCancel,
    );

// Initial Product Quantity
showInitialProductQuantityBottomSheet(BuildContext context, {VoidCallback onDelete, VoidCallback onCancel}) => showDeleteInfoBottomSheet(
      context,
      S.current.initial_product_quantity,
      S.current
          .you_have_set_an_inventory_opening_balance_in_the_coa_adding_new_product_with_initial_quantity_may_cause_inventory_amount_to_be_overcounted_please_confirm,
      sureBtnText: S.current.proceed_to_save,
      onDelete: onDelete,
      onCancel: onCancel,
    );

// Switch Financial Year Confirmation
showSwitchFinancialYearConfirmationBottomSheet(BuildContext context, String content, {VoidCallback onConfirm, VoidCallback onCancel}) =>
    showDeleteInfoBottomSheet(context, S.current.switch_financial_year, content, onDelete: () {
      Navigator.pop(context, true);
    }, onCancel: onCancel, sureBtnText: S.current.confirm, cancelText: S.current.cancel);

// Close Financial Year Confirmation
showCloseFinancialYearConfirmationBottomSheet(BuildContext context, String content, {VoidCallback onConfirm, VoidCallback onCancel}) =>
    showDeleteInfoBottomSheet(context, S.current.close_financial_year, content, onDelete: () {
      Navigator.pop(context, true);
    }, onCancel: onCancel, sureBtnText: S.current.confirm, cancelText: S.current.cancel);

/// 删除信息对话框
showDeleteInfoBottomSheet(
  BuildContext context,
  String title,
  String content, {
  String subTitle,
  InlineSpan contentSpan,
  VoidCallback onDelete,
  VoidCallback onCancel,
  String sureBtnText,
  String cancelText,
}) =>
    showDefaultInfoBottomSheet(context,
        child: DeleteInfo(
          onCancel: onCancel,
          onDelete: onDelete,
          title: title,
          subTitle: subTitle,
          content: content,
          contentSpan: contentSpan,
          sureBtnText: sureBtnText,
          cancelText: cancelText,
        ));

showLiInfoBottomSheet(BuildContext context, String title, List<String> content,
        {VoidCallback onDelete, VoidCallback onCancel, String sureBtnText, String cancelText, bool li}) =>
    showDefaultInfoBottomSheet(
      context,
      child: LiItemInfo(
        onCancel: onCancel,
        onDelete: onDelete,
        title: title,
        content: content,
        li: li,
        sureBtnText: sureBtnText,
        cancelText: cancelText,
      ),
    );

class DeleteInfo extends StatelessWidget {
  final VoidCallback onDelete;
  final VoidCallback onCancel;
  final String title;
  final String subTitle;
  final InlineSpan contentSpan;
  final String content;
  final String sureBtnText;
  final String cancelText;

  const DeleteInfo({Key key, this.onDelete, this.onCancel, this.contentSpan, this.sureBtnText, this.title, this.subTitle, this.content, this.cancelText})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Column(
      mainAxisSize: MainAxisSize.min,
      children: [
        // SizedBox(
        //   height: getDp(10),
        // ),
        Text(
          title,
          textAlign: TextAlign.center,
          style: TextStyle(
            color: aceBlackColor,
            fontSize: getSp(22),
            fontWeight: FontWeight.w700,
            height: 24 / 22,
          ),
        ),
        if (subTitle != null)
          Padding(
            padding: EdgeInsets.only(top: getDp(20)),
            child: Text(
              subTitle,
              textAlign: TextAlign.center,
              style: TextStyle(
                color: aceBlackColor,
                fontSize: getSp(16),
                fontWeight: FontWeight.w700,
                height: 22 / 16,
              ),
            ),
          ),
        if (contentSpan != null)
          Padding(
            padding: EdgeInsets.only(top: getDp(20)),
            child: Text.rich(
              TextSpan(children: [
                contentSpan,
              ], style: TextStyle(color: aceBlackColor, fontSize: getSp(16), fontWeight: FontWeight.w400, height: 22 / 16, fontFamily: "DinRoundPro")),
            ),
          ),
        if (content != null)
          Padding(
            padding: EdgeInsets.only(top: getDp(20), left: getDp(10), right: getDp(10)),
            child: Text(
              content,
              textAlign: TextAlign.center,
              style: TextStyle(
                color: aceBlackColor,
                fontSize: getSp(16),
                fontWeight: FontWeight.w400,
                height: 22 / 16,
              ),
            ),
          ),
        AppSpaces.h30,
        NormalButton(
          title: sureBtnText ?? S.current.delete,
          onTap: onDelete ??
              () {
                Navigator.of(context).pop(true);
              },
        ),
        SizedBox(
          height: getDp(10),
        ),
        PressedOpacityButton(
          onPressed: onCancel ??
              () {
                Navigator.of(context).pop(false);
              },
          padding: EdgeInsets.symmetric(
            vertical: getDp(10),
            horizontal: getDp(10),
          ),
          child: Text(
            cancelText ?? S.current.cancel,
            style: TextStyle(
              color: aceBlueColor,
              fontSize: getSp(16),
              fontWeight: FontWeight.w700,
              height: 20 / 16,
            ),
          ),
        ),
      ],
    );
  }
}

class LiItemInfo extends StatelessWidget {
  final VoidCallback onDelete;
  final VoidCallback onCancel;
  final String title;
  final String subTitle;
  final InlineSpan contentSpan;
  final List<String> content;
  final bool li;
  final String sureBtnText;
  final String cancelText;

  const LiItemInfo(
      {Key key, this.onDelete, this.onCancel, this.contentSpan, this.sureBtnText, this.title, this.subTitle, this.content, this.cancelText, this.li})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Column(
      mainAxisSize: MainAxisSize.min,
      children: [
        // SizedBox(
        //   height: getDp(10),
        // ),
        Text(
          title,
          textAlign: TextAlign.center,
          style: TextStyle(
            color: aceBlackColor,
            fontSize: getSp(22),
            fontWeight: FontWeight.w700,
            height: 24 / 22,
          ),
        ),
        if (subTitle != null)
          Padding(
            padding: EdgeInsets.only(top: getDp(20)),
            child: Text(
              subTitle,
              textAlign: TextAlign.center,
              style: TextStyle(
                color: aceBlackColor,
                fontSize: getSp(16),
                fontWeight: FontWeight.w700,
                height: 22 / 16,
              ),
            ),
          ),
        if (contentSpan != null)
          Padding(
            padding: EdgeInsets.only(top: getDp(20)),
            child: Text.rich(
              TextSpan(children: [
                contentSpan,
              ], style: TextStyle(color: aceBlackColor, fontSize: getSp(16), fontWeight: FontWeight.w400, height: 22 / 16, fontFamily: "DinRoundPro")),
            ),
          ),
        if (content != null && content.length != 0)
          Padding(
            padding: EdgeInsets.only(top: getDp(20), left: getDp(10), right: getDp(10)),
            child: Column(
              children: content
                  .map(
                    (e) => Row(
                      children: [
                        li == true
                            ? Container(
                                width: 5,
                                height: 5,
                                margin: EdgeInsets.only(right: getDp(5), left: getDp(30)),
                                decoration: BoxDecoration(
                                  color: Colors.black87,
                                  borderRadius: BorderRadius.all(
                                    Radius.circular(5),
                                  ),
                                ),
                              )
                            : Container(),
                        Text(
                          e,
                          textAlign: TextAlign.center,
                          style: TextStyle(
                            color: aceBlackColor,
                            fontSize: getSp(16),
                            fontWeight: FontWeight.w400,
                            height: 22 / 16,
                          ),
                        )
                      ],
                    ),
                  )
                  .toList(),
            ),
          ),
        AppSpaces.h30,
        NormalButton(
          title: sureBtnText ?? S.current.delete,
          onTap: onDelete ??
              () {
                Navigator.of(context).pop(true);
              },
        ),
        SizedBox(
          height: getDp(10),
        ),
        PressedOpacityButton(
          onPressed: onCancel ??
              () {
                Navigator.of(context).pop(false);
              },
          padding: EdgeInsets.symmetric(
            vertical: getDp(10),
            horizontal: getDp(10),
          ),
          child: Text(
            cancelText ?? S.current.cancel,
            style: TextStyle(
              color: aceBlueColor,
              fontSize: getSp(16),
              fontWeight: FontWeight.w700,
              height: 20 / 16,
            ),
          ),
        ),
      ],
    );
  }
}
